/**
 * Copyright ©2012-2018 HopeHaiyang Corporation, All Rights Reserved
 * http://www.wuhanhope.com
 */
package hujia.profile.study.web;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * class info
 *
 * @author hujia
 *         Create at 2018/8/1 15:42
 */
@RestController
@RequestMapping("/hello")
public class HelloController {

    @GetMapping
    public String hello(HttpServletRequest request) throws Exception {
        request.getSession().setAttribute("data","hujia");
        return request.getSession().getId();
    }

    @GetMapping("/world")
    public String world(HttpServletRequest request) throws Exception{
        return request.getSession().getAttribute("data").toString();
    }
}
